home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / ifp1s155.zip / PAGE_06.PAS < prev    next >
Pascal/Delphi Source File  |  1992-04-21  |  38KB  |  1,192 lines

  1. unit page_06;
  2.  
  3. interface
  4.  
  5. uses crt, dos, graph, ifpglobl, ifpcomon, ifpextrn;
  6.  
  7. procedure page06;
  8.  
  9. implementation
  10.  
  11. procedure page06;
  12. const
  13.   atividmons: array[0..15] of string[24] =
  14.                ('EGA', 'analog monochrome', 'TTL monochrome', 'analog color',
  15.                 'RGB color', 'Multisync or compatible', '(unknown)',
  16.                 'PS/2 8514 or compatible', 'Seiko 1430', 'MultiSync 2A',
  17.                 'Tatung OmniScan', 'NEC 3D or compatible', 'TVM 3M',
  18.                 'NEC MultiSync XL/+/4D/5D', 'TVM 2A', 'TVM 3A');
  19.   trividmons: array[0..7] of string[17] =
  20.                ('MDA', 'CGA', 'EGA', 'Digital multisync', 'VGA', '8514',
  21.                 'SuperVGA', 'Analog multisync');
  22.   parachips: array[1..4] of string[7] =
  23.                ('PVGA1A', 'WD90C00', 'WD90C10', 'WD90C11');
  24.  
  25.  
  26. type
  27.   cardtype = (none, vesa, standard, paradise, video7, ati, ahead, cirrus,
  28.                cti, genoa, trident, tseng, zymos);
  29.   VESAitype = record
  30.                 signature: array[0..3] of char;
  31.                 version: word;
  32.                 OEMnameOfs: word;
  33.                 OEMnameSeg: word;
  34.                 capabilities: array[0..3] of byte;
  35.                 modesOfs: word;
  36.                 modesSeg: word;
  37.                 reserved: array[0..237] of byte;
  38.               end;
  39.   VESAmtype = record
  40.                 modeattr: word;
  41.                 winaattr: byte; {Window A attributes}
  42.                 winbattr: byte; {Window B attributes}
  43.                 wingran: word;  {Window Granularity}
  44.                 winsize: word;  {Window Size}
  45.                 winaseg: word;  {Window A segment}
  46.                 winbseg: word;  {Window B segment}
  47.                 posOfs: word;   {Offset of Far call to positioning function}
  48.                 posSeg: word;   {Segment ..}
  49.                 scansize: word; {Bytes per scan line}
  50.                 {The following information is optional for VESA modes,
  51.                  required for OEM modes}
  52.                 pixwidth: word;
  53.                 pixheight: word;
  54.                 charwidth: byte;
  55.                 charheight: byte;
  56.                 memplanes: byte;
  57.                 pixelbits: byte;
  58.                 banks: byte;
  59.                 memmodel: byte;
  60.                 banksize: byte;
  61.                 reserved: array[0..227] of byte;
  62.               end;
  63.  
  64. ATIvidtype = record
  65.                columns: byte;
  66.                maxrow: byte;
  67.                lines_a_row: byte;
  68.                buffer_size: word;
  69.                seqreg: array[1..4] of byte;
  70.                miscreg: byte;
  71.                crtsreg: array[0..$18] of byte;
  72.                attrreg: array[0..$13] of byte;
  73.                graphreg: array[0..8] of byte;
  74.              end;
  75.  
  76. var
  77.   i : byte;
  78.   VGAbuf : array[$00..$10] of byte;
  79.   VESAinfo: VESAitype;
  80.   VESAmode: VESAmtype;
  81.   xbyte, xbyte2, xbyte3, paralock1, paralock2: byte;
  82.   xword1 : word;
  83.   xword2 : word;
  84.   xword3 : word;
  85.   xword4 : word;
  86.   vgacard: cardtype;
  87.   vidmem : word;
  88.   s: string;
  89.   c: char;
  90.   saveattr, savex, savey: byte;
  91.   foundone, foundit: boolean;
  92.  
  93. procedure captfont;
  94.   begin
  95.   caption1('Font           Address');
  96.   Writeln;
  97.   Write('INT 1FH        ');
  98.   segofs(longint(intvec[$1F]) shr 16, longint(intvec[$1F]) and $0000FFFF);
  99.   Writeln
  100.   end; {captfont}
  101.  
  102. procedure showfont(a : byte);
  103.   const
  104.     fontnames: array [0..7] of string[12] = (
  105.                  'INT 1FH     ',
  106.                  'INT 43H     ',
  107.                  'ROM 8x14    ',
  108.                  'ROM 8x8 (lo)',
  109.                  'ROM 8x8 (hi)',
  110.                  'ROM 9x14    ',
  111.                  'ROM 8x16    ',
  112.                  'ROM 9x16    ');
  113.  
  114.   begin
  115.   with regs do
  116.     begin
  117.     Write(fontnames[a], '   ');
  118.     AX:=$1130;
  119.     BH:=a;
  120.     intr($10, regs);
  121.     segofs(ES, BP);
  122.     Writeln
  123.     end
  124.   end; {showfont}
  125.  
  126. procedure int101210;
  127.   const
  128.     memnames: array[0..3] of string[4] = ('64K', '128K', '192K', '256K');
  129.  
  130.   begin
  131.   with regs do
  132.     begin
  133.     AH:=$12;
  134.     BL:=$10;
  135.     intr($10, regs);
  136.     caption2('Display type');
  137.     case BH of
  138.       $00 : Writeln('color');
  139.       $01 : Writeln('monochrome')
  140.       else
  141.         unknown('display', BH, 2)
  142.     end;
  143.     caption2('Memory');
  144.     if vidmem > 0 then
  145.       Writeln(vidmem, 'K')
  146.     else
  147.       if BL < 4 then
  148.         Writeln(memnames[BL], ' as determined from standard BIOS call')
  149.       else
  150.         unknown('size', BL, 2);
  151.     if vgacard = none then
  152.       begin
  153.       caption2('Feature bits');
  154.       Writeln(bin4(CH and $0F));
  155.       caption2('DIP switches (EGA)');
  156.       Writeln(bin4(CL and $0F))
  157.       end
  158.     end
  159.   end;
  160.  
  161.   function readROM(seg, ofs: word; length: byte): string;
  162.     var
  163.       x: word;
  164.       s: string;
  165.  
  166.     begin
  167.     s:='';
  168.     for x:=ofs to ofs + (length - 1) do
  169.       s:=s + Chr(Mem[seg:x]);
  170.     readROM:=s
  171.     end; {readROM}
  172.  
  173.   procedure checking(s: string);
  174.     var
  175.       x, y: byte;
  176.     begin
  177.     x:=WhereX;
  178.     y:=WhereY;
  179.     ClrEol;
  180.     Write('Checking for ', s);
  181.     GotoXY(x, y);
  182.     end; {checking}
  183.  
  184.   procedure d8or16bit(b: boolean);
  185.     begin
  186.     if b then
  187.       Write('8-bit')
  188.     else
  189.       Write('16-bit');
  190.     end;
  191.  
  192.   procedure cli;
  193.     inline($FA);
  194.  
  195.   procedure sti;
  196.     inline($FB);
  197.  
  198.   function isXGA: word;
  199.     var
  200.       POSport, cardID, tmpw: word;
  201.       tmp, tmp1, tmp2, tmp3, tmp4: byte;
  202.       slot: byte;
  203.       regs: registers;
  204.       foundit: boolean;
  205.  
  206.     begin
  207.     isXGA:=0;
  208.     foundit:=false;
  209.     with regs do
  210.       begin
  211.       DX:=$FFFF;
  212.       AX:=$C400;
  213.       Intr($15, regs);
  214.       if (not nocarry(regs)) or (DX = -1) then
  215.         Exit;
  216.       posport:=DX;
  217.       slot:=0;
  218.       repeat
  219.         cli;
  220.         if slot = 0 then
  221.           Port[$94]:=$DF
  222.         else
  223.           begin
  224.           AX:=$C401;
  225.           BX:=slot;
  226.           Intr($15, regs)
  227.           end;
  228.         cardID:=PortW[POSport];
  229.         tmp1:=Port[POSport + 2];
  230.         tmp2:=Port[POSport + 3];
  231.         tmp3:=Port[POSport + 4];
  232.         tmp4:=Port[POSport + 5];
  233.         if slot = 0 then
  234.           Port[$94]:=$FF
  235.         else
  236.           begin
  237.           AX:=$C402;
  238.           BX:=slot;
  239.           Intr($15, regs);
  240.           end;
  241.         cli;
  242.         if (cardID >= $8FD8) and (cardID <= $8FDB) then
  243.           begin
  244.           tmpw:=tmp1 and $E;
  245.           POSport:=(tmpw shl 3) + $2100;
  246.           Port[POSport + $A]:=$52;
  247.           tmp:=Port[POSport + $B] and $F;
  248.           if (tmp <> 0) and (tmp <> $F) then
  249.             foundit:=true
  250.           else
  251.             Inc(slot);
  252.           end
  253.         else
  254.           Inc(slot);
  255.       until foundit or (slot > 9);
  256.       end;
  257.     if foundit then
  258.       isXGA:=POSport;
  259.     end; {isXGA}
  260.  
  261.   procedure isport2(var regs: registers; var foundit: boolean);
  262.     var
  263.       savebx, saveax: word;
  264.       tmp: byte;
  265.  
  266.     begin
  267.     with regs do
  268.       begin
  269.       savebx:=BX;
  270.       BX:=AX;
  271.       Port[DX]:=AL;
  272.       AH:=AL;
  273.       AL:=Port[DX + 1];
  274.       tmp:=AH;
  275.       AH:=AL;
  276.       AL:=tmp;
  277.       saveax:=AX;
  278.       AX:=BX;
  279.       PortW[DX]:=AX;
  280.       Port[DX]:=AL;
  281.       AH:=AL;
  282.       AL:=Port[DX + 1];
  283.       AL:=AL and BH;
  284.       foundit:=(AL = BH);
  285.       if AL = BH then
  286.         begin
  287.         AL:=AH;
  288.         AH:=0;
  289.         Port[DX]:=AX;
  290.         Port[DX]:=AL;
  291.         AH:=AL;
  292.         AL:=Port[DX + 1];
  293.         AL:=AL and BH;
  294.         foundit:=(AL = 0);
  295.         end;
  296.       AX:=saveax;
  297.       PortW[DX]:=AX;
  298.       BX:=savebx;
  299.       end;
  300.     end;
  301.  
  302.   begin (* procedure page_06 *)
  303.   vgacard:=none;
  304.   caption2('Display adapter');
  305.   checking('VESA');
  306.   with regs do
  307.     begin
  308.     AX:=$4F00;
  309.     ES:=Seg(VESAinfo);
  310.     DI:=Ofs(VESAinfo);
  311.     Intr($10, regs);
  312.     s:='';
  313.     if (AL = $4F) and (AH = 0) and (VESAinfo.signature = 'VESA') then
  314.       begin
  315.       with VESAinfo do
  316.         begin
  317.         vgacard:=vesa;
  318.         ClrEol;
  319.         Writeln('VESA version ', Hi(version), decimal, Lo(version));
  320.         caption2('OEM ID');
  321.         xword1:=OEMnameSeg;
  322.         xword2:=OEMnameOfs;
  323.         s:='';
  324.         c:=Chr(Mem[xword1:xword2]);
  325.         while c <> #0 do
  326.           begin
  327.           Write(c);
  328.           s:=s + c;
  329.           Inc(xword2);
  330.           c:=Chr(Mem[xword1:xword2])
  331.           end;
  332.         caption3('Manufacturer');
  333.         if s = '761295520' then
  334.           Writeln('ATI')
  335.         else
  336.           Writeln(s)
  337.         end;
  338.       caption1('Video modes supported:');
  339.       Writeln;
  340.       xword2:=VESAinfo.modesSeg;
  341.       xword3:=VESAinfo.modesOfs;
  342.       with VESAmode do
  343.         while MemW[xword2:xword3] <> $FFFF do
  344.           begin
  345.           xword1:=MemW[xword2:xword3];
  346.           pause3(4);
  347.           if endit then
  348.             Exit;
  349.           caption2('Number');
  350.           Write(hex(xword1, 4));
  351.           AX:=$4F01;
  352.           CX:=xword1;
  353.           ES:=Seg(VESAmode);
  354.           DI:=Ofs(VESAmode);
  355.           Intr($10, regs);
  356.           if (AX = $004F) and (modeattr and 1 = 1) then
  357.             begin
  358.             caption3('Mode');
  359.             if modeattr and 8 = 8 then
  360.               Write('Color ')
  361.             else
  362.               Write('Monochrome ');
  363.             if modeattr and $10 = $10 then
  364.               Write('graphics')
  365.             else
  366.               Write('text');
  367.             caption3('BIOS output support');
  368.             yesorno(modeattr and 4 = 4);
  369.             if modeattr and 2 = 2 then
  370.               begin
  371.               caption3('Screen size');
  372.               Write(pixwidth, 'x', pixheight);
  373.               caption3('Character size');
  374.               Write(charwidth, 'x', charheight);
  375.               caption3('Colors');
  376.               Writeln(exp((pixelbits * 1.0) * ln(2.0)):1:0);
  377.               caption3('Memory model');
  378.               case memmodel of
  379.                 0: Write('Text');
  380.                 1: Write('CGA');
  381.                 2: Write('Hercules');
  382.                 3: Write('4-plane');
  383.                 4: Write('Packed-pixel');
  384.                 5: Write('Nonchain 4');
  385.                 6..$0F: Write('(reserved)');
  386.               else
  387.                 Write('(unknown)')
  388.               end;
  389.               caption3('Memory planes');
  390.               Write(memplanes);
  391.               caption3('Memory banks');
  392.               Write(banks);
  393.               if banks > 1 then
  394.                 begin
  395.                 caption3('Bank size');
  396.                 Write(banksize, 'K')
  397.                 end;
  398.               Writeln;
  399.               end;
  400.  
  401.             Inc(xword3, 2);
  402.             end;
  403.           end;
  404.       TextColor(LightGreen);
  405.       Write('The next screen will show standard information, so ');
  406.       pause1;
  407.       if endit then
  408.         Exit;
  409.       ClrScr;
  410.       caption2('Display adapter');
  411.       end;
  412.     end;
  413.   vgacard:=none;
  414.   vidmem:=0;
  415.   ClrEol;
  416.   case graphdriver of
  417.     CGA : begin
  418.           Writeln('CGA');
  419.           captfont
  420.           end;
  421.     MCGA : begin
  422.            Writeln('MCGA');
  423.            captfont;
  424.            showfont($01);
  425.            showfont($03);
  426.            showfont($04);
  427.            showfont($06)
  428.            end;
  429.     EGA..EGAmono : begin
  430.                  Writeln('EGA');
  431.                  captfont;
  432.                  showfont($01);
  433.                  showfont($02);
  434.                  showfont($03);
  435.                  showfont($04);
  436.                  showfont($05);
  437.                  int101210;
  438.                  xbyte:=mem[BIOSdseg : $0087];
  439.                  caption2('Mode change preserves screen buffer');
  440.                  yesorno(xbyte and $80 = $80);
  441.                  caption2('EGA active');
  442.                  yesorno(xbyte and $08 = $00);
  443.                  caption2('Wait for display enable');
  444.                  yesorno(xbyte and $04 = $04);
  445.                  caption2('CGA cursor emulation');
  446.                  yesorno(xbyte and $01 = $00);
  447.            (*  PC Magazine 6:12 p.326  *)
  448.                  caption2('Save area                    ');
  449.                  xword1:=memw[BIOSdseg : $00AA];
  450.                  xword2:=memw[BIOSdseg : $00A8];
  451.                  segofs(xword1, xword2);
  452.                  Writeln;
  453.            (*  PC Tech Journal 3:4 p.65  *)
  454.                  caption2('Video parameter table        ');
  455.                  segofs(memw[xword1 : xword2 +  2], memw[xword1 : xword2]);
  456.                  Writeln;
  457.                  caption2('Dynamic save area            ');
  458.                  xword3:=memw[xword1 : xword2 +  6];
  459.                  xword4:=memw[xword1 : xword2 +  4];
  460.                  if (xword3 > $0000) or (xword4 > $0000) then
  461.                    begin
  462.                    segofs(xword3, xword4);
  463.                    Writeln
  464.                    end
  465.                  else
  466.                    Writeln('(none)');
  467.                  caption2('Auxiliary character generator');
  468.                  xword3:=memw[xword1 : xword2 + 10];
  469.                  xword4:=memw[xword1 : xword2 +  8];
  470.                  if (xword3 > $0000) or (xword4 > $0000) then
  471.                    begin
  472.                    segofs(xword3, xword4);
  473.                    Writeln
  474.                    end
  475.                  else
  476.                    Writeln('(none)');
  477.                  caption2('Graphics mode auxiliary table');
  478.                  xword3:=memw[xword1 : xword2 + 14];
  479.                  xword4:=memw[xword1 : xword2 + 12];
  480.                  if (xword3 > $0000) or (xword4 > $0000) then
  481.                    segofs(xword3, xword4)
  482.                  else
  483.                    Write('(none)')
  484.            (*  PC Tech Journal 3:4 p.67  *)
  485.                end;
  486.     hercmono : begin
  487.                Writeln('Hercules or MDA');
  488.                captfont
  489.                end;
  490.     IBM8514 : begin
  491.               Writeln('IBM 8514');
  492.               captfont
  493.               end;
  494.     ATT400 : begin
  495.              Writeln('AT&T 400');
  496.              captfont
  497.              end;
  498.     VGA : begin
  499.           if novgacheck then
  500.             begin
  501.             Writeln('VGA');
  502.             caption3('Chipset');
  503.             Writeln('Detection blocked by INFOPLUS /NV switch!');
  504.             end
  505.           else
  506.             begin
  507.             xword1:=isXGA;
  508.             if xword1 > 0 then
  509.               if Port[xword1] and 1 = 1 then
  510.                 Writeln('XGA')
  511.               else
  512.                 Writeln('VGA, XGA on other monitor')
  513.             else
  514.               Writeln('VGA');
  515.             vidmem:=0;
  516.             caption3('Chipset');
  517.             vgacard:=standard;
  518.             if vgacard = standard then
  519.               begin
  520.               checking('Video 7');
  521.               if Port[$3CC] and 1 = 1 then
  522.                 xword1:=$3D0
  523.               else
  524.                 xword1:=$3B0;
  525.               Port[xword1 + 4]:=$C;
  526.               i:=Port[xword1 + 5];
  527.               Port[xword1 + 5]:=$55;
  528.               xbyte:=Port[xword1 + 5];
  529.               Port[xword1 + 4]:=$1F;
  530.               xbyte2:=Port[xword1 + 5];
  531.               Port[xword1 + 4]:=$C;
  532.               Port[xword1 + 5]:=i;
  533.               if xbyte2 = $55 xor $EA then
  534.                 begin
  535.                 vgacard:=video7;
  536.                 ClrEol;
  537.                 Write('Video 7 - ');
  538.                 port[$3C4]:=$8E;
  539.                 xbyte:=Port[$3C5];
  540.                 case xbyte of
  541.                   $80..$FF: Writeln('Vega VGA');
  542.                   $70..$7F: with regs do
  543.                               begin
  544.                               AX:=$6F07;
  545.                               Intr($10, regs);
  546.                               if (AH and $80) = $80 then
  547.                                 Writeln('VRAM')
  548.                               else
  549.                                 Writeln('FastWrite');
  550.                               end;
  551.                   $50..$59: Writeln('VGA Version 5');
  552.                   $40..$49: Writeln('1024i')
  553.                 else
  554.                   Writeln('unknown value $', hex(xbyte, 2));
  555.                 end;
  556.                 caption3('  Chip revision');
  557.                 Port[$3C4]:=$8E;
  558.                 Write(Port[$3C5]);
  559.                 Port[$3C4]:=$FF;
  560.                 xbyte:=Port[$3C5];
  561.                 with regs do
  562.                   begin
  563.                   AX:=$6F07;
  564.                   Intr($10, regs);
  565.                   if AL = $6F then
  566.                     begin
  567.                     vidmem:=256 * (AH and $7F);
  568.                     caption3('Memory type');
  569.                     if AH and $80 = $80 then
  570.                       Writeln('VRAM')
  571.                     else
  572.                       Writeln('DRAM')
  573.                     end
  574.                   else
  575.                     vidmem:=256;
  576.                   end;
  577.                 caption3('  Memory');
  578.                 d8or16bit((xbyte and 1) = 0);
  579.                 caption3('I/O');
  580.                 d8or16bit((xbyte and 2) = 0);
  581.                 caption3('BIOS');
  582.                 d8or16bit((xbyte and 8) = 0);
  583.                 caption3('bus');
  584.                 caption3('Fast-Write');
  585.                 yesorno((xbyte and 4) = 4);
  586.                 end;
  587.               end;
  588.             if vgacard = standard then
  589.               begin
  590.               checking('AHEAD');
  591.               s:=readROM($C000, $25, 5);
  592.               if s = 'AHEAD' then
  593.                 begin
  594.                 vgacard:=ahead;
  595.                 ClrEol;
  596.                 Writeln('Ahead');
  597.                 end
  598.               end;
  599.             if vgacard = standard then
  600.               begin
  601.               checking('Genoa');
  602.               s:=readROM($C000, MemW[$C000:$37], 4);
  603.               if (s[1] = #$77) and (Copy(s, 3, 2) = #$99#$66) then
  604.                 begin
  605.                 vgacard:=genoa;
  606.                 ClrEol;
  607.                 Write('Genoa ');
  608.                 case Ord(s[2]) of
  609.                   $33: Write('5100/5200 (Tseng ET3000 based)');
  610.                   $55: Write('5300/5400 (Tseng ET3000 based)');
  611.                   $22: Write('6100');
  612.                   $00: Write('6200/6300');
  613.                   $11: Write('6400/6600')
  614.                 else
  615.                   Write('(unknown type - $', hex(Ord(s[2]), 2), ')');
  616.                 end;
  617.                 Writeln;
  618.                 if (s[2] = #$33) or (s[2] = #$55) then
  619.                   begin
  620.                   end
  621.                 else
  622.                   begin
  623.                   Port[$3C4]:=5;
  624.                   xbyte:=Port[$3C5];
  625.                   caption3('  Bus');
  626.                   if (xbyte and 1) = 1 then
  627.                     Write('PC')
  628.                   else
  629.                     Write('MCA');
  630.                   caption3('Video width');
  631.                   d8or16bit((xbyte and 2) = 2);
  632.                   caption3('BIOS width');
  633.                   d8or16bit((xbyte and 4) = 4);
  634.                   caption3('I/O ports at');
  635.                   if (xbyte and $10) = $10 then
  636.                     Writeln('$3xx')
  637.                   else
  638.                     Writeln('$2xx');
  639.                   caption3('  BIOS size');
  640.                   case (xbyte and $60) shr 5 of
  641.                     0, 3: Write('24K');
  642.                     1: Write('30K');
  643.                     2: Write('32K')
  644.                   end;
  645.                   Port[$3C4]:=7;
  646.                   xbyte:=Port[$3C5];
  647.                   caption3('Monitor type');
  648.                   if (xbyte and $20) = $20 then
  649.                     Write('TTL digital')
  650.                   else
  651.                     Write('analog');
  652.                   caption3('Chipset on');
  653.                   if (xbyte and 8) = 8 then
  654.                     Writeln('motherboard')
  655.                   else
  656.                     Writeln('adapter card');
  657.                   Port[$3C4]:=$10;
  658.                   xbyte:=Port[$3C5];
  659.                   caption3('  Fast scroll');
  660.                   yesorno2((xbyte and 1) = 1);
  661.                   caption3('Fast address');
  662.                   yesorno2((xbyte and 2) = 2);
  663.                   caption3('Fast write');
  664.                   yesorno((xbyte and $40) = $40);
  665.                   Port[$3C4]:=8;
  666.                   xbyte:=Port[$3C5];
  667.                   caption3('  70Hz vertical retrace');
  668.                   yesorno2((xbyte and $10) = $10);
  669.                   xword1:=MemW[$40:$63];
  670.                   Port[xword1]:=$2F;
  671.                   xbyte:=Port[xword1 + 1];
  672.                   caption3('Interlaced');
  673.                   yesorno((xbyte and 1) = 1);
  674.                   end
  675.                 end
  676.               end;
  677.             if vgacard = standard then
  678.               begin
  679.               checking('Cirrus');
  680.               xword1:=CirrusCK;
  681.               if xword1 <> 0 then
  682.                 begin
  683.                 vgacard:=cirrus;
  684.                 ClrEol;
  685.                 Write('Cirrus');
  686.                 caption3('chipset type');
  687.                 case xword1 of
  688.                   $EC: Write('510/520');
  689.                   $CA: Write('610/620');
  690.                   $EA: Write('Video Seven')
  691.                 else
  692.                   Write('unknown - $', hex(xword1, 2))
  693.                 end;
  694.                 caption3('Cirrus BIOS');
  695.                 s:=readROM($C000, 6, 2);
  696.                 yesorno(s = 'CL');
  697.                 end;
  698.               end;
  699.             if vgacard = standard then
  700.               begin
  701.               checking('CTI');
  702.               Port[$46E8]:=$1E;
  703.               xbyte:=Port[$104];
  704.               Port[$46E8]:=$E;
  705.               if xbyte = $A5 then
  706.                 with regs do
  707.                   begin
  708.                   AH:=$5F;
  709.                   AL:=0;
  710.                   Intr($10, regs);
  711.                   ClrEol;
  712.                   Write('CTI 82C45');
  713.                   Port[$46E8]:=$1E;
  714.                   Port[$103]:=$80;
  715.                   Port[$46E8]:=$E;
  716.                   Port[$3D6]:=0;
  717.                   xbyte:=Port[$3D7];
  718.                   xbyte3:=(xbyte and $F0) shr 4;
  719.                   if xbyte3 = 1 then
  720.                     begin
  721.                     Port[$3D6]:=$3A;
  722.                     i:=Port[$3D7];
  723.                     Port[$3D7]:=$AA;
  724.                     xbyte2:=Port[$3D7];
  725.                     Port[$3D7]:=i;
  726.                     if xbyte2 = $AA then
  727.                       xbyte3:=2
  728.                     else
  729.                       xbyte3:=1;
  730.                     end;
  731.                   Port[$46E8]:=$1E;
  732.                   Port[$103]:=0;
  733.                   Port[$46E8]:=$E;
  734.                   Port[$3D6]:=0;
  735.                   Str(xbyte3:0, s);
  736.                   Writeln(s);
  737.                   vgacard:=CTI;
  738.                   case BH of
  739.                     0: vidmem:=256;
  740.                     1: vidmem:=512;
  741.                     2: vidmem:=1024;
  742.                   else
  743.                     vidmem:=0;
  744.                   end;
  745.                   caption3('  Chip revision');
  746.                   Writeln(xbyte and $0F);
  747.                   caption3('micro-channel');
  748.                   yesorno2(CX and 2 = 2);
  749.                   caption3('DAC size');
  750.                   if CX and 1 = 1 then
  751.                     Writeln('8-bit')
  752.                   else
  753.                     Writeln('6-bit');
  754.                   end;
  755.               end;
  756.             if vgacard = standard then
  757.               begin
  758.               checking('Trident');
  759.               Port[$3C4]:=$0B;
  760.               xbyte:=Port[$3C5];
  761.               if (xbyte <= 6) and (xbyte >= 2) then
  762.   {
  763.                 Port[$3C5]:=Port[$3C5];
  764.                 Port[$3C4]:=$0E;
  765.                 i:=Port[$3C5];
  766.                 Port[$3C5]:=0;
  767.                 xbyte:=Port[$3C5] and $0F;
  768.                 Port[$3C5]:=i;
  769.                 if xbyte = 2 then
  770.   }
  771.                 begin
  772.                 vgacard:=trident;
  773.                 ClrEol;
  774.                 Write('Trident ');
  775.   {
  776.                 Port[$3C4]:=$0B;
  777.                 Port[$3C5]:=0;
  778.                 xbyte3:=Port[$3C5];
  779.   }
  780.                 case xbyte of
  781.                   1: Writeln('8800BR');
  782.                   2: Writeln('8800CS')
  783.                 else
  784.                   begin
  785.                   Writeln('8900');
  786.                   Port[$3C4]:=$1F;
  787.                   xbyte:=Port[$3C5] and 3;
  788.                   case xbyte of
  789.                     0: vidmem:=256;
  790.                     1: vidmem:=512;
  791.                     2, 3: vidmem:=1024;
  792.                   end; {case}
  793.                   end;
  794.                 end;
  795.                 caption3('  BIOS');
  796.                 Port[$3C4]:=$F;
  797.                 xbyte:=Port[$3C5];
  798.                 d8or16bit((xbyte and $80) = 0);
  799.                 caption3('interlaced');
  800.                 Port[$3C4]:=$1E;
  801.                 xbyte:=Port[$3C5];
  802.                 yesorno((xbyte and $20) = $20);
  803.                 with regs do
  804.                   begin
  805.                   AX:=$7000;
  806.                   BX:=0;
  807.                   Intr($10, regs);
  808.                   if AL = $70 then
  809.                     begin
  810.                     caption3('Everex Card');
  811.                     DX:=(DX and $FFF0) shr 4;
  812.                     case DX of
  813.                       $678: Write('Viewpoint');
  814.                       $236: Write('Ultragraphics II');
  815.                       $620: Write('Vision VGA');
  816.                       $673: Write('EVGA')
  817.                     else
  818.                       dontknow2;
  819.                     end; {case}
  820.                     vidmem:=((CH shr 6) * 256) + 256;
  821.                     caption3('Monitor');
  822.                     if CL < 8 then
  823.                       Writeln(trividmons[CL])
  824.                     else
  825.                       Writeln('(unknown) - ', CL);
  826.                     end
  827.                   end;
  828.                 end;
  829.               end;
  830.             if vgacard = standard then
  831.               begin
  832.               checking('Tseng');
  833.               xbyte:=tsengCK;
  834.               if xbyte = 1 then
  835.                 begin
  836.                 ClrEol;
  837.                 Write('Tseng ET');
  838.                 if Port[$3CC] and 1 = 1 then
  839.                   xword:=$3D0
  840.                 else
  841.                   xword:=$3B0;
  842.                 Port[xword + 4]:=$33;
  843.                 xbyte:=Port[xword + 5];
  844.                 Port[xword + 5]:=xbyte xor $F;
  845.                 xbyte2:=Port[xword + 5];
  846.                 Port[xword + 5]:=xbyte;
  847.                 if xbyte2 = xbyte xor $F then
  848.                   begin
  849.                   Write('4000');
  850.                   Port[$3BF]:=3;
  851.                   Port[$3D8]:=$A0;
  852.                   with regs do
  853.                     begin
  854.                     AX:=$10F1;
  855.                     BL:=0;
  856.                     Intr($10, regs);
  857.                     if BL <> 0 then
  858.                       Writeln(' w/ HiColor RAMDAC')
  859.                     end;
  860.                   Port[xword + 4]:=$37;
  861.                   xbyte:=Port[xword + 5];
  862.                   if xbyte and 8 = 0 then
  863.                     vidmem:=256
  864.                   else
  865.                     case xbyte and 3 of
  866.                       0,1: vidmem:=256;
  867.                       2: vidmem:=512;
  868.                       3: vidmem:=1024;
  869.                     end
  870.                   end
  871.                 else
  872.                   Write('3000');
  873.                 caption3('ROM');
  874.                 d8or16bit((xbyte and $10) = 0);
  875.                 caption3('Video');
  876.                 Port[xword + 4]:=$36;
  877.                 xbyte:=Port[xword + 5];
  878.                 d8or16bit((xbyte and $40) = 0);
  879.                 caption3('I/O');
  880.                 d8or16bit((xbyte and $80) = 0);
  881.                 Writeln;
  882.                 Port[xword + 4]:=$37;
  883.                 xbyte:=Port[xword + 5];
  884.                 caption3('Memory type');
  885.                 if xbyte and $80 = $80 then
  886.                   Write('VRAM')
  887.                 else
  888.                   Write('DRAM');
  889.                 Port[$3C4]:=7;
  890.                 xbyte:=Port[$3C5];
  891.                 caption3('Compatibility');
  892.                 if xbyte and $80 = $80 then
  893.                   Write('VGA')
  894.                 else
  895.                   Write('EGA');
  896.                 caption3('ROM address');
  897.                 if xbyte and $20 = 0 then
  898.                   if xbyte and 8 = 0 then
  899.                     Writeln('C000-C3FF')
  900.                   else
  901.                     Writeln('disabled')
  902.                 else
  903.                   if xbyte and 8 = 0 then
  904.                     Writeln('C000-C5FF and C680 - C7FF')
  905.                   else
  906.                     Writeln('C000-C7FF');
  907.                 vgacard:=tseng
  908.                 end;
  909.               end;
  910.             if vgacard = standard then
  911.               begin
  912.               checking('ZyMOS');
  913.               if zymosCK = 2 then
  914.                 begin
  915.                 ClrEol;
  916.                 Writeln('ZyMOS');
  917.                 vgacard:=zymos
  918.                 end;
  919.               end;
  920.             if vgacard = standard then
  921.               begin
  922.               checking('Oak');
  923.               with regs do
  924.                 begin
  925.                 DX:=$3DE;
  926.                 AX:=$FF11;
  927.                 isport2(regs, foundit);
  928.                 if foundit then
  929.                   begin
  930.                   ClrEol;
  931.                   Writeln('Oak');
  932.                   Port[$3DE]:=$D;
  933.                     asm
  934.                        jmp  @1
  935.                     @1:
  936.                     end;
  937.                   xbyte:=Port[$3DF];
  938.                   if xbyte and $80 = $80 then
  939.                     vidmem:=512
  940.                   else
  941.                     vidmem:=256;
  942.                   end;
  943.                 end;
  944.               end;
  945.             if vgacard = standard then
  946.               with regs do
  947.                 begin
  948.                 checking('ATI');
  949.                 s:=readROM($C000, $31, 9);
  950.                 if s = '761295520' then
  951.                   begin
  952.                   vgacard:=ati;
  953.                   ClrEol;
  954.                   Write('ATI ');
  955.                   c:=Chr(Mem[$C000:$43]);
  956.                   case c of
  957.                     '1': Write('18800');
  958.                     '2': Write('18800-1');
  959.                     '3': Write('28800-2');
  960.                     '4': Write('28800-4');
  961.                     '5': Write('28800-5');
  962.                   end;
  963.                   caption3('Board');
  964.                   s:=readROM($C000, $40, 2);
  965.                   if s = '31' then
  966.                     Write('VGAWonder');
  967.                   if s = '32' then
  968.                     Write('EGAWonder 800+');
  969.                   caption3('Revision');
  970.                   Write(Mem[$C000:$4C], decimal, Mem[$C000:$4D]);
  971.                   xbyte:=Mem[$C000:$42];
  972.                   caption3('mouse port');
  973.                   yesorno(xbyte and 2 = 2);
  974.                   caption3('programmable video clock');
  975.                   yesorno2(xbyte and $10 = $10);
  976.                   xword1:=MemW[$C000:$10];
  977.                   xbyte:=ATIinfo($BB, xword1);
  978.                   caption3('monitor');
  979.                   Writeln(atividmons[xbyte and $0F]);
  980.                   if c > '0' then
  981.                     begin
  982.                     xbyte:=Mem[$C000:$44];
  983.                     caption3('70Hz non-interlace');
  984.                     yesorno2(xbyte and 1 = 1);
  985.                     caption3('Korean chars');
  986.                     yesorno2(xbyte and 2 = 2);
  987.                     caption3('Memory clock');
  988.                     if (xbyte and 4 = 4) then
  989.                       Writeln('45MHz')
  990.                     else
  991.                       Writeln('40MHz');
  992.                     caption3('Zero wait state');
  993.                     yesorno2(xbyte and 8 = 8);
  994.                     caption3('Paged ROMs');
  995.                     yesorno2(xbyte and $10 = $10);
  996.                     caption3('8514/A');
  997.                     yesorno2(xbyte and $40 <> $40);
  998.                     caption3('HiColor DAC');
  999.                     yesorno(xbyte and $80 = $80);
  1000.                     end;
  1001.                   caption3('Video modes');
  1002.                   xbyte2:=0;
  1003.                   foundone:=false;
  1004.                   for xbyte:=0 to 255 do
  1005.                     begin
  1006.                     AH:=$12;
  1007.                     AL:=xbyte;
  1008.                     BX:=$5506;
  1009.                     BP:=$FFFF;
  1010.                     Intr($10, regs);
  1011.                     if BP <> $FFFF then
  1012.                       begin
  1013.                       Write(hex(xbyte, 2), ' ');
  1014.                       Inc(xbyte2);
  1015.                       foundone:=true;
  1016.                       if xbyte2 = 21 then
  1017.                         begin
  1018.                         Writeln;
  1019.                         Write('               ');
  1020.                         xbyte2:=0;
  1021.                         end;
  1022.                       end;
  1023.                     end;
  1024.                   if (not foundone) or (foundone and (xbyte <> 0)) then
  1025.                     Writeln;
  1026.                   vidmem:=256;
  1027.                   if (c = '1') or (c = '2') then
  1028.                     begin
  1029.                     if ATIinfo($BB, xword1) and $20 = $20 then
  1030.                       vidmem:=512;
  1031.                     end
  1032.                   else
  1033.                     begin
  1034.                     xbyte:=ATIinfo($B0, xword1);
  1035.                     if xbyte and $10 = $10 then
  1036.                       vidmem:=512;
  1037.                     if c <> '3' then
  1038.                       if xbyte and 8 = 8 then
  1039.                         vidmem:=1024;
  1040.                     end;
  1041.                   end;
  1042.                 end;
  1043.             if vgacard = standard then
  1044.               begin
  1045.               checking('Paradise');
  1046.               s:=readROM($C000, $7D, 4);
  1047.               if s = 'VGA=' then
  1048.                 begin
  1049.                 vgacard:=paradise;
  1050.                 ClrEol;
  1051.                 Write('Western Digital/Paradise ');
  1052.                 Port[$3CE]:=$F;
  1053.                 paralock1:=Port[$3CF];
  1054.                 Port[$3CF]:=5;
  1055.                 Port[$3C4]:=7;
  1056.                 if Port[$3CC] and 1 = 1 then
  1057.                   xword:=$3D0
  1058.                 else
  1059.                   xword:=$3B0;
  1060.                 Port[xword + 4]:=$29;
  1061.                 paralock2:=Port[xword + 5];
  1062.                 Port[xword + 5]:=$85;
  1063.                 PortW[$3C4]:=$4806;
  1064.                 Port[xword + 4]:=$2B;
  1065.                 xbyte:=Port[xword + 5];
  1066.                 Port[xword + 5]:=$AA;
  1067.                 xbyte2:=Port[xword + 5];
  1068.                 Port[xword + 5]:=xbyte;
  1069.                 if xbyte2 <> $AA then
  1070.                   xbyte3:=1
  1071.                 else
  1072.                   begin
  1073.                   Port[$3C4]:=$12;
  1074.                   xbyte:=Port[$3C5];
  1075.                   Port[$3C5]:=xbyte and $BF;
  1076.                   xbyte2:=Port[$3C5] and $40;
  1077.                   if xbyte2 <> 0 then
  1078.                     begin
  1079.                     Port[$3C5]:=xbyte;
  1080.                     xbyte3:=2;
  1081.                     end
  1082.                   else
  1083.                     begin
  1084.                     Port[$3C5]:=xbyte or $40;
  1085.                     xbyte2:=Port[$3C] and $40;
  1086.                     if xbyte2 = 0 then
  1087.                       begin
  1088.                       Port[$3C5]:=xbyte;
  1089.                       xbyte3:=2;
  1090.                       end
  1091.                     else
  1092.                       begin
  1093.                       Port[$3C5]:=xbyte;
  1094.                       xbyte3:=4;
  1095.                       Port[$3C4]:=$10;
  1096.                       xbyte:=Port[$3C5];
  1097.                       Port[$3C5]:=xbyte and $FB;
  1098.                       xbyte2:=Port[$3C5] and 4;
  1099.                       if xbyte2 <> 0 then
  1100.                         xbyte3:=3;
  1101.                       Port[$3C5]:=xbyte or 4;
  1102.                       xbyte2:=Port[$3C5] and 4;
  1103.                       if xbyte2 = 0 then
  1104.                         xbyte3:=3;
  1105.                       Port[$3C5]:=xbyte;
  1106.                       end
  1107.                     end
  1108.                   end;
  1109.                 Writeln(parachips[xbyte3]);
  1110.                 Port[$3CE]:=$0B;
  1111.                 for xbyte:=1 to 2 do;
  1112.                 xbyte:=Port[$3CF];
  1113.                 vidmem:=word(64) * (xbyte shr 4);
  1114.                 caption3('Video');
  1115.                 d8or16bit((xbyte and 4) = 0);
  1116.                 caption3('ROM');
  1117.                 d8or16bit((xbyte and 2) = 0);
  1118.                 caption3('Frequencies are');
  1119.                 Port[$3CE]:=$0F;
  1120.                 xbyte:=Port[$3CF];
  1121.                 if (xbyte and $80) = $80 then
  1122.                   Writeln('multi-sync')
  1123.                 else
  1124.                   Writeln('fixed-sync');
  1125.                 Port[xword + 4]:=$29;
  1126.                 Port[xword + 5]:=paralock2;
  1127.                 Port[$3CE]:=$F;
  1128.                 Port[$3CF]:=paralock1;
  1129.                 end;
  1130.               end;
  1131.             if vgacard = standard then
  1132.               begin
  1133.               ClrEol;
  1134.               dontknow;
  1135.               end;
  1136.             end;
  1137.           captfont;
  1138.           showfont($01);
  1139.           showfont($02);
  1140.           showfont($03);
  1141.           showfont($04);
  1142.           showfont($05);
  1143.           showfont($06);
  1144.           showfont($07);
  1145.           int101210;
  1146.           saveattr:=TextAttr;
  1147.           savex:=WhereX;
  1148.           savey:=WhereY;
  1149.           TextColor(LightRed + Blink);
  1150.           Write('**Retrieving palette information**');
  1151.           with regs do
  1152.             begin
  1153.             AX:=$1009;
  1154.             ES:=seg(VGAbuf);
  1155.             DX:=ofs(VGAbuf);
  1156.             intr($10, regs)
  1157.             end;
  1158.           GotoXY(savex, savey);
  1159.           Write('                                  ');
  1160.           GotoXY(savex, savey);
  1161.           TextAttr:=saveattr;
  1162.           caption2('Palette registers');
  1163.           for i:=$00 to $0F do
  1164.             Write(hex(VGAbuf[i], 2), ' ');
  1165.           Writeln;
  1166.           caption2('Border color');
  1167.           Write(hex(VGAbuf[$10], 2));
  1168.           caption3('Color page');
  1169.           with regs do
  1170.             begin
  1171.             AX:=$101A;
  1172.             intr($10, regs);
  1173.             Write('$', hex(BH, 2));
  1174.             caption3('Paging mode');
  1175.             case BL of
  1176.               $00 : Writeln('4 pages of 64 registers');
  1177.               $01 : Writeln('16 pages of 16 registers')
  1178.               else
  1179.                 unknown('mode', BL, 2)
  1180.             end
  1181.             end
  1182.         end;
  1183.     PC3270 : begin
  1184.              Writeln('3270 PC');
  1185.              captfont
  1186.              end
  1187.   else
  1188.     unknown('adapter', graphdriver, 4)
  1189.   end {case}
  1190.   end; {page06}
  1191. end.
  1192.